//
//  BHCompetitionAdditionModel.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/6/11.
//

import UIKit

class BHCompetitionAdditionModel: NSObject {
    var name: String = ""
    var addtionId: String = ""
    
    var childAdditionArray: [BHCompetitionAdditionModel] = []
    
    
    static var classArray: [BHCompetitionAdditionModel]  {
        get {
            let firstClassNameArray: [String] = ["全部","跑步","羽毛球","铁人三项","篮球","足球"]
            let secClassArray: [String] = ["全部跑步","马拉松","越野跑","徒步","健康跑"]
            var array: [BHCompetitionAdditionModel] = []
            for (index,nameText) in firstClassNameArray.enumerated() {
                let model: BHCompetitionAdditionModel = BHCompetitionAdditionModel.init()
                model.name = nameText
                model.addtionId = "\(index)"
                if index != 0 {
                    for (childIndex, childText) in secClassArray.enumerated() {
                        let childModel: BHCompetitionAdditionModel = BHCompetitionAdditionModel.init()
                        childModel.name = childText
                        childModel.addtionId = "\(childIndex)"
                        model.childAdditionArray.append(childModel)
                    }
                }
                array.append(model)
            }
            return array
        }
    }
    
    static var areaArray: [BHCompetitionAdditionModel]  {
        get {
            let firstClassNameArray: [String] = ["全国","北京","天津","河北","江苏","浙江","安徽"]
            let secClassArray: [String] = ["全部","东城区","西城区","朝阳区","丰台区","石景山区"]
            var array: [BHCompetitionAdditionModel] = []
            for (index,nameText) in firstClassNameArray.enumerated() {
                let model: BHCompetitionAdditionModel = BHCompetitionAdditionModel.init()
                model.name = nameText
                model.addtionId = "\(index)"
                if index != 0 {
                    for (childIndex, childText) in secClassArray.enumerated() {
                        let childModel: BHCompetitionAdditionModel = BHCompetitionAdditionModel.init()
                        childModel.name = childText
                        childModel.addtionId = "\(childIndex)"
                        model.childAdditionArray.append(childModel)
                    }
                }
                array.append(model)
            }
            return array
        }
    }
    
    
    static var sortArray: [BHCompetitionAdditionModel] {
        get {
            let array: [String] = ["智能排序","离我最近"/*,"报名最多","费用最低"*/]
            var tempArray: [BHCompetitionAdditionModel] = []
            
            for (index,nameText) in array.enumerated() {
                let model: BHCompetitionAdditionModel = BHCompetitionAdditionModel.init()
                model.name = nameText
                model.addtionId = "\(index)"
             
                tempArray.append(model)
            }
            return tempArray
        }
    }
    
    
    static var stateArray: [BHCompetitionAdditionModel] {
        get {
            let array: [String] = ["全部","未开始","进行中","已结束"]
            var tempArray: [BHCompetitionAdditionModel] = []
            
            for (index,nameText) in array.enumerated() {
                let model: BHCompetitionAdditionModel = BHCompetitionAdditionModel.init()
                model.name = nameText
                model.addtionId = "\(index)"
             
                tempArray.append(model)
            }
            return tempArray
        }
    }
}
